<template>
  <div class="body" style="margin-top:39px">
    <div class="head1 jlayoutCenter">{{bpmcoreI18n.processDiagram}}</div>
    <div style="width:100%;height:auto">
      <iframe id="diagramIframe" :src="showDiagramUrl" style="background: #e1e1e1;width:100%;height:850px;border:none"/>
    </div>
</div>
</template>

<script>
import {mapState} from 'vuex'

export default {
  name: 'MainScene',
  data () {
    return {
      isDialogVisible: false
    }
  },
  computed: {
    ...mapState(['inst', 'bpmcoreI18n', 'hsInput', 'showDiagramUrl'])
    // showDiagramUrl: function () {
    //   let host = window.location.protocol + '//' + window.location.host
    //   console.log('host----->', host)
    //   if (host === 'http://localhost:8080') {
    //     host = 'http://bpmdev02.whchem.com' // 本地调试链接开发，需要登录或者单点
    //   }
    //   let diagramUrl = ''
    //   if (this.inst && this.inst.id) {
    //     if (this.hsInput && this.hsInput.ts_piid && this.hsInput.ts_piid === '-1') {
    //       diagramUrl = host + '/ECS_BPM_ADV/jsp/trdpty/processMapNew.jsp?bpdId=' + this.inst.bpdId + '&appShortName=' + this.inst.appShortName
    //     } else {
    //       diagramUrl = host + '/ECS_BPM_ADV/jsp/trdpty/processMapNew.jsp?bpdId=' + this.inst.bpdId + '&appShortName=' + this.inst.appShortName + '&tsPiid=' + this.inst.id
    //     }
    //   }
    //   return diagramUrl
    // }
  },
  methods: {
  }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
  .body {
    display: flex;
    flex-direction: column;
    font-size: 12px;
  }
  .head1 {
    background: url(/static/images/contentBg.png) repeat-x 0 -337px;
    color: #475d68;
    font-size: 14px;
    font-weight: bold;
    width: 980px;
    height: 26px;
    line-height: 26px;
  }
</style>
